<?php

class SettingRecord extends TActiveRecord
{
	const TABLE = 'settings';
	
	// fields
	public $name;
	public $value;

	public function setName($name)                 { $this->name = $name; }
	public function setValue($value)               { $this->value = $value; }
	
	public function getName()          { return $this->name; }
	public function getValue()         { return $this->value; }
	
	public function setData($name, $value)
	{
		$this->name			= $name;
		$this->value		= $value;
	}
	
	public function setDataBySettingRecord($record)
	{
		if($record instanceof SettingRecord)
		{
			$this->setData($record->getName(), $record->getValue());
		}
	}
	
	public function equals($record)
	{
		if($record instanceof SettingRecord)
		{
			return	$this->getName() == $record->getName()		&&
					$this->getValue() == $record->getValue();
		}
		return false;
	}
	
	public static function finder($className=__CLASS__)
	{
		return parent::finder($className);
	}
}

?>